import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import {a_asyncAccount } from './store/actions/msgActions'

export default function Form() {
    const account = useSelector(state => 
              state.login.account,
    )
    const password = useSelector(state => 
             state.login.password
        
    )


    const dispatch= useDispatch()
    const handleAccount = e => {
        console.log(e);
        dispatch(a_asyncAccount(e.target.value)
        )
    }
    const handlePassword = () => {
        
    }
  return (
    <div>
        <label htmlFor="">
            用户名：
            <input type="text" value={account} onChange={handleAccount}/>
        </label>
        <br />
        <label htmlFor="">
            密码：
            <input type="text" value={password} onChange={handlePassword}/>
        </label>
        <br />
        <button>登录</button>
    </div>
  )
}
